
 /**
 * Authority.java.java.
 * User: BrianChen Date: 2012-7-31 下午05:38:56
 *
 * Copyright (c) 2009 Hewlett-Packard Development Company, L.P.
 * All rights reserved.
 */
package com.collapsar.core.security.model;

import java.util.Set;

import com.collapsar.core.orm.model.VersionalEntity;

/**
 * <pre>
 * REVISIONS: 
 * Version 	Date 		Author 			Description
 * ------------------------------------------------------------------- 
 * 1.0 		2012-7-31 	BrianChen 	1. Created this class. 
 * </pre>
 * 
 * @author BrianChen
 * @date 2012-7-31 下午05:38:56
 * @version 1.0
 * @see
 * 
 */
@SuppressWarnings("serial")
public class Authority extends VersionalEntity{
	private String code = null;
	private String name = null;
	
	private String menuName = null;
	private String actionUrl = null;
	
	private Set<Role> roles = null;
	
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMenuName() {
		return menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public String getActionUrl() {
		return actionUrl;
	}

	public void setActionUrl(String actionUrl) {
		this.actionUrl = actionUrl;
	}

	public Set<Role> getRoles() {
		return roles;
	}

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}

	@Override
	public int hashCode() {
		return this.code.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if(this == obj){
			return true;
		}
		if(!(obj instanceof Authority)){
			return false;
		}
		final Authority authority = (Authority)obj;
		if(!this.code.equals(authority.getCode())){
			return false;
		}
		return true;
	}
	
	
	

}

